package com.xunai.saas.example.controller;

import com.xunai.saas.example.model.param.FaceAnalysisParam;
import com.xunai.saas.example.model.param.FaceAnswerAnalysisParam;
import com.xunai.saas.example.service.FaceService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * 面诊示例接口
 *
 * @author Admin
 */
@RequestMapping("/faceApi")
@RestController
public class FaceApiExample {

    @Resource
    FaceService faceService;

    /**
     * 面诊接口
     *
     * @return
     */
    @PostMapping("/faceAnalysis")
    public String faceAnalysis(@RequestBody FaceAnalysisParam faceAnalysisParam) {
        return faceService.faceAnalysis(faceAnalysisParam);
    }

    /***
     * 回答问题,循环回答
     * @param faceAnswerAnalysisParam
     * @return
     */
    @PostMapping("/faceAnswerAnalysis")
    public String faceAnswerAnalysis(@RequestBody FaceAnswerAnalysisParam faceAnswerAnalysisParam) {
        return faceService.faceAnswerAnalysis(faceAnswerAnalysisParam);
    }

    /***
     * 获取结果
     * @param faceId
     * @return
     */
    @GetMapping("/faceResultQuery/{faceId}")
    public String faceResultQuery(@PathVariable String faceId) {
        return faceService.faceResultQuery(faceId);
    }
}
